/**
 * 
 */
package com.antilia.infomaresme.pages.details;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import com.antilia.infomaresme.data.dataobjects.Item;

/**
 * @author Ernesto
 *
 */
public class PropertiesPanel extends Panel {

	private static final long serialVersionUID = 1L;

	/**
	 * @param id
	 */
	public PropertiesPanel(String id, final IModel<Item> model) {
		super(id, model);
			
		add(new Label("title", model.getObject().getTitle()));
		//add(new Label("shortDescription", model.getObject().getShortDescription())); 
		add(new Label("price", model.getObject().getPrice() != null?model.getObject().getPrice().toString(): "NO PRICE")); 
		//TODO format
		add(new Label("otherDate", model.getObject().getOtherDate().toString()));
		//add(new Label("status", new ResourceModel("ItemStatus."+model.getObject().getStatus())));		
		add(new Label("categoryTitle", model.getObject().getCategoryTitle())); 		
		add(new Label("geographicLocation", model.getObject().getPlace())); 
		add(new Label("description", model.getObject().getDescription()).setEscapeModelStrings(false));
				
	}
}
